<?php
include('../../inc/global.inc');
include("../islogin.php");
if($_GET['del_act']){
mysql_query("delete from hot_product where id='".$_GET['del_id']."'");
echo "<script>location='index.php';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
</HEAD>
<BODY>
<center>
  <table width="70%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">热点产品目录 &nbsp;&nbsp;<a href="javascript:history.go(-1)">返回</a></td>
    </tr>
  </table>
  <table width="70%" border="0" cellspacing="0" cellpadding="0">
    <form method="get" action="search.php">
      <tr>
        <td height="25"><font color="#0000FF">搜索：</font>
            <input name="s_name" type="text" size="20">
          &nbsp;
          <input name="submit" type="submit" value="搜索"></td>
      </tr>
    </form>
  </table>
  <table width="70%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td width="8%" height="30" align="center" bgcolor="#8DA8CF">编号</td>
      <td width="41%" align="center" bgcolor="#8DA8CF">热点产品目录名</td>
      <td width="9%" align="center" bgcolor="#8DA8CF">排名</td>
      <td width="28%" align="center" bgcolor="#8DA8CF">拼音</td>
      <td width="14%" align="center" bgcolor="#8DA8CF"><a href="index_modify.php?tj=ok&id=<?=$_GET[id]?>">添加热点产品</a></td>
    </tr>
<?php
if($_GET[id]){
$sql="select * from hot_product where hot_id='".$_GET['id']."' order by id asc";
}else{
$sql="select * from hot_product where hot_id=0 order by hot_ping asc,id asc";}
$rs=mysql_query($sql);
$i=1;
while($row=mysql_fetch_array($rs)){
$color=($i%2)?"#FFFFFF":"#eeeeee";
$rs2=mysql_query("select * from hot_product where hot_id='".$row['id']."'");
$row2=mysql_fetch_array($rs2);
$num=mysql_num_rows($rs2);
mysql_free_result($rs2);
?>
    <tr bgcolor=<?=$color?>>
      <td height="25" align="center"><?=$i?></td>
	  <td align="left" style="padding-left:10px;"><?=$row[hot_name]?>(<a href='index.php?id=<?=$row['id']?>'><font color='red'><?=$num?></font></a>)</td>
      <td align="center"><?php if($row[hot_istop]==1){echo "<font color='red'>是</font>";}else{echo "否";}?></td>
      <td align="center" style="padding-left:10px;"><?=$row[hot_ping]?></td>
      <td align="center"><a href="index_modify.php?xg=ok&xg_id=<?=$row['id']?>">编辑</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="index.php?del_act=ok&del_id=<?=$row['id']?>" onClick="return del()">删除</a></td>
    </tr>
<?php
$i++;}
?>
  </table>
</center>
</BODY>
</HTML>
